package com.hsogoo.avatar.executor.disruptor;

import com.lmax.disruptor.EventHandler;
import com.lmax.disruptor.WorkHandler;

/**
 * Created by za-huangsaigang on 2018/10/29.
 */
public class TaskHandler implements EventHandler<AvatarEvent<Runnable>>, WorkHandler<AvatarEvent<Runnable>> {
    @Override
    public void onEvent(AvatarEvent<Runnable> event, long sequence, boolean endOfBatch) throws Exception {
        event.getTask().run();
    }

    @Override
    public void onEvent(AvatarEvent<Runnable> event) throws Exception {
        event.getTask().run();
    }
}
